import { Component } from "@xuekl/cli-core/enums"
import * as c from "@xuekl/cli-core/components"
import { BaseForm } from "@xuekl/cli-core/builder"

export default class Dictdata extends BaseForm {
    dictType = ''
    dictLabel = ''
    dictValue = ''
    cssClass = ''
    dictSort = 0
    listClass = ''
    status = '0'
    remark = ''
    dictCode = ''

    clear(): void {
        this.setForm(new Dictdata(this.opts))
        this.resetFields()
    }

    getDictType(): c.Input {
        return {
            type: Component.Input,
            label: '字典类型',
            mode: ['query'],
            element: {
                disabled: true
            }
        }
    }

    getDictLabel(): c.Input {
        return {
            type: Component.Input,
            label: '数据标签',
            mode: ['query'],
            required: true,
            element: {
            }
        }
    }

    getDictValue(): c.Input {
        return {
            type: Component.Input,
            label: '数据键值',
            required: true,
            element: {
            }
        }
    }

    getCssClass(): c.Input {
        return {
            type: Component.Input,
            label: '样式属性',
            element: {
            }
        }
    }

    getDictSort(): c.InputNumber {
        return {
            type: Component.InputNumber,
            label: '显示排序',
        }
    }

    getListClass(): c.Select {
        return {
            type: Component.Select,
            label: '回显样式',
            config: {
                list: [{ value: 'val01', label: '选项一' }, { value: 'val02', label: '选项二' }]
            },
            element: {
            }
        }
    }

    getStatus(): c.Radio {
        return {
            type: Component.Radio,
            label: '状态',
            config: {
                dict: 'sys_normal_disable'
            }
        }
    }

    getRemark(): c.Textarea {
        return {
            type: Component.Textarea,
            label: '备注',
        }
    }
}
